package hcn.protocol.brandnew.feiyong.zhifu;

import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import lombok.Data;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;


/**
 * 住院预缴金记录记录-响应消息（成功） - ODS_04020005_SUC
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class ListPaymentHistoryResponse {

    /**
     * 预缴金记录LIST
     */
    @XmlElementWrapper(name = "RequestLists")
    @XmlElement(name = "RequestList")
    private List<RequestList> requestLists;


    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class RequestList {

        /**
         * 住院号码
         */
        @XmlElement(name = "HospizationId")
        private String hospizationId;
        /**
         * 医院ID，医院系统身份标识
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 医院名称，公有模板，可能为空
         */
        @XmlElement(name = "VisitOrganizationName")
        private String visitOrganizationName;
        /**
         * 姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 住院号
         */
        @XmlElement(name = "VisitId")
        private String visitId;

        /**
         * 付款明细集合
         */
        @XmlElementWrapper(name = "PaymentRecords")
        @XmlElement(name = "PaymentRecord")
        private List<PaymentRecord> paymentRecords;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class PaymentRecord {

        /**
         * 付款金额
         */
        @XmlElement(name = "Prepaid")
        private Double prepaid;
        /**
         * 支付方式，1-支付宝/2-微信/3-银联/4-聚合支付-支付宝/5-聚合支付-微信,其它支付方式另外约定
         */
        @XmlElement(name = "MedicalCostPayTypeCode")
        private String medicalCostPayTypeCode;
        /**
         * 支付方式中文
         */
        @XmlElement(name = "MedicalCostPayTypeName")
        private String medicalCostPayTypeName;
        /**
         * 付款时间
         */
        @XmlElement(name = "SettleDateTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date settleDateTime;
    }

}
